package com.ebt.dl.config;

import com.ebt.dl.filter.CORSResponseFilter;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;

import org.glassfish.jersey.filter.LoggingFilter;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.server.ServerProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JerseyInitialization extends ResourceConfig {
	/**
	 * Register JAX-RS application components.
	 */
	public JerseyInitialization() {
		this.register(new JacksonJsonProvider(ObjectMapperFactory.create()));
		this.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
		this.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);
		this.packages("com.ebt.dl.resource");
		this.packages("com.ebt.dl.provider");
		
		register(LoggingFilter.class);
		register(CORSResponseFilter.class);
	}
}